package com.atguigu.yygh.oss.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantProperties implements InitializingBean {

    @Value("${oss.endpoint}")
    private String endpoint ;

    @Value("${oss.accessKeyId}")
    private String accessKeyId ;

    @Value("${oss.accessKeySecret}")
    private String accessKeySecret ;

    @Value("${oss.bucketName}")
    private String bucketName;

    public static String ENDPOINT ;
    public static String ACCESSKEYID ;
    public static String ACCESSKEYSECRET ;
    public static String BUCKETNAME;



    @Override
    public void afterPropertiesSet() throws Exception {
        this.ENDPOINT = endpoint;
        this.ACCESSKEYID = accessKeyId;
        this.ACCESSKEYSECRET = accessKeySecret;
        this.BUCKETNAME = bucketName;
    }
}
